import time

from Base import Base

from selenium.webdriver.common.by import By

class Page2(Base):

    # 客户姓名
    name_loc = (By.XPATH,'/html/body/div[1]/div/section/section/main/div[1]/form/div[1]/div/div/div/input')
    def name(self):
        self.send_keys(self.name_loc,'孟勤凯')

    # 搜索按钮
    search_loc = (By.XPATH,'//*[@id="app"]/div/section/section/main/div[1]/form/div[2]/div[1]/div/div/button/span')
    def search(self):
        self.click(self.search_loc)


    # 查询业务
    def test_search(self):
        # 获取网址
        self.open_url('http://localhost:8081/xklist')
        time.sleep(3)
        # 输入客户姓名
        self.name()
        time.sleep(5)

        # 点击搜索按钮
        self.search()
        time.sleep(10)